﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using DailyDiet.Services;
using DailyDiet.Services.Impl;
using Moq;

namespace DailyDietTest.Helper
{
    public static class SplitSentenceServiceTestHelper {
        private static ISplitSentenceService _splitSentenceService;
        public static async Task<ISplitSentenceService> GetSplitSentenceService() {
            if (_splitSentenceService != null) {
                return _splitSentenceService;
            }
            var PreferenceMock = new Mock<IPreferenceStorage>();
            PreferenceMock.Setup(p => p.Get("isFillRecorderMessage", -1))
                .Returns(-1);
            var mockedPreference = PreferenceMock.Object;
            _splitSentenceService =
                new SplitSentenceService(mockedPreference);
            return _splitSentenceService;
        }
    }
}
